export interface Extra {
    extra?: string;
}


export enum MessageState {
    sending = 1,
    arrive = 2,
    error = 3
}


export enum ContactsModelState {
    create= 'create',
    invitation ='invitation',
    remove ='remove'
}

export enum MessageType {
    TxtMsg = 1,
    ImgMsg = 2,
    SightMsg = 3,
    FileMsg = 4,

    VideoOffer = 50, //对方发起了视频通话
    VideoAnswer = 51, //对方接受了视频通话
    VideoRefuse = 52, // 对方拒绝了视频通话
    Candidate = 53, // 
    VideoNoResponse = 54, // 视频未响应
    VideoInterrupt = 55, // 视频中断
    VideoHangUp = 56, // 挂断
    VideoBusyLine =57 , // 忙线
    VideoCancel =58 , // 取消


    AddFriend = 11,
    VerifiedBy = 12,


    createGroup = 20,
    invitationGroup = 21,
    removeUserGroup = 22,
    updateNameGroup = 23,
    noticeGroup = 24,
}


export interface TextMessage extends Extra {
    content: string;

}

export interface ImageMessage extends Extra {
    content: string;
    imageUri: string;
}

export interface SightMessage extends Extra {
    content: string;
    sightUrl: string;
    duration: number;
    size: string;
    name: string;
}


export interface FileMessage extends Extra {
    name: string;
    fileUrl: string;
    type: number;
    size: string;
    
}



// export interface Message {
//     to: string;
//     from: string;
//     content: TextMessage | ImageMessage | SightMessage | FileMessage;
//     fp: string;
//     typeu: MessageType

// }

// 会话类型
export enum ConversationType {
    system = 0,
    private = 1,
    group = 2,
}

// 会话列表
export interface Conversation {
    type: ConversationType
    lastMessage: any
    targetId: string
    top?: boolean
    disturb?: boolean
    unreadCount?: number
    userName: string,
    portrait: string,
    timestamp?: number,
    remark?: String,

}